import { get, post, deletes, put } from './axios.js'
// const http = 'http://47.105.207.235/v1' http://pc.hdyhlz.com
const http = '/v1'
// const http2 = '/v2'
// const http = 'http://pc.hdyhlz.com/v1'
// const http2 = 'http://pc.hdyhlz.com/v2'
// const http = 'http://192.168.31.118:8899/v1'
// const http2 = 'http://192.168.31.118:8899/v2'
// const http = 'http://cs.zgmjzw.com/v7' // 测试地址
const myregMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57]|19[0-9]|16[0-9])[0-9]{8}$/
// 加密
const getRSACode = (params) => {
    return get(`${http}/common/rsaEncrypt`, { sign: params })
}
// 解密
const getRsaDecrypt = (params) => {
    return get(`${http}/common/rsaDecrypt`, { sign: params })
}

// 获取公告等系统通知
const getSystem = params => {
    return get(`${http}/system/system`, { secret: params })
}
/**
 *
 *获取周开奖列表
 * @param {
    * timestamp=时间戳
    * } params 加密字符串
    * @returns
    */
const lotteryWeek = params => {
    return get(`${http}/lottery/week`, { secret: params })
}
/**
 *
 *获取开奖记录
 * @param {
    * timestamp=时间戳
    * } params 加密字符串
    * @returns
    */
const lotteryRecord = params => {
    return get(`${http}/lottery/list`, { secret: params })
}

export default {
    get,
    deletes,
    put,
    post,
    myregMobile,
    getRSACode,
    getRsaDecrypt,
    lotteryWeek,
    getSystem,
    lotteryRecord
}
